package com.example.demo.aspect;

import com.example.demo.aspect.annotation.ThankCustomer;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author cc
 * @date 2018/9/22 13:59
 */
@Aspect
@Slf4j
@Component
public class AspectContract {

    @Pointcut(value = "execution(* com.example.demo.controller.*.*(..))")
    public void cutController() {
    }

    @Pointcut(value = "execution(* com.example.demo.controller.HelloRestaurant.order(..))")
    public void cutOrderDishes() {

    }

    // TODO: 2018/9/22
    @After(value = "cutOrderDishes() && @annotation(thankCustomer)")
    public void welcomeCustomer(JoinPoint joinPoint, ThankCustomer thankCustomer) {

    }
}
